package day10_io_code.com.itheima.d5_dataOutputStream;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.security.DigestInputStream;

public class Demo2_DataInputStream {
    public static void main(String[] args) {
        try(
                // 1、创建高级的特殊数据输入流管道包装低级的字节输入流管道。
                DataInputStream dis = new DataInputStream(new FileInputStream("day10_io_code/a.txt"));
                ){
            byte b = dis.readByte();
            System.out.println("b = " + b);

            boolean b1 = dis.readBoolean();
            System.out.println("b1 = " + b1);

            int i = dis.readInt();
            System.out.println("i = " + i);

            char c = dis.readChar();
            System.out.println("c = " + c);

            String s = dis.readUTF();
            System.out.println("s = " + s);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
